#include "pthread_pool.hpp"
#include "Task.hpp"

#include <ctime>
#include <cstdlib>

using namespace ns_threadpool;
using namespace ns_task;

int main()
{
    std::cout<<"当前运行其他进程代码...."<<std::endl;
    std::cout<<"当前运行其他进程代码...."<<std::endl;
    std::cout<<"当前运行其他进程代码...."<<std::endl;
    
    sleep(3);


    srand((long long)time(nullptr));

    while (true)
    {   
        sleep(1);
    Task t(rand() % 10 + 1, rand() % 10 + 1, "+-*/"[rand() % 4]);
       ThreadPool<Task>::GetInstance()->PushTask(t);
       std::cout << ThreadPool<Task>::GetInstance() << std::endl;
    }
    
    return 0;
}